package com.m.service.impl;

import com.m.dao.entity.LoginEntity;
import com.m.dao.mapper.LoginMapper;
import com.m.service.ICommonService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 功能: <br/>
 *
 * @author miracle
 */
@Service
public class CommonServiceImpl implements ICommonService {
    private static final Logger logger = LoggerFactory.getLogger(SceneServiceImpl.class);

    @Resource
    private LoginMapper loginMapper;

    @Override
    public LoginEntity login(String userName, String passwd) {
        LoginEntity getByUserNameAndPasswd = loginMapper.getByUserNameAndPasswd(userName, passwd);
        if (getByUserNameAndPasswd != null) {
            return getByUserNameAndPasswd;
        }
        throw new RuntimeException("账户信息不存在,请联系管理员!");
    }

    @Override
    public void logout(Long userId) {

    }
}
